﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;

namespace ApiGateway.Auth.Dto
{
    public class AuthPath
    {
        public AuthPath()
        {
            var configuration = new ConfigurationBuilder()
                .AddJsonFile("Configs/AppSettings.json", optional: true, reloadOnChange: true)
                .Build();
            AuthorizationRoutePath = configuration["AuthPath:AuthorizationRoutePath"];
            AuthorizationUserInfo = configuration["AuthPath:AuthorizationUserInfo"];
            AuthorizationLogout = configuration["AuthPath:AuthorizationLogout"];
            AuthorizationReflush = configuration["AuthPath:AuthorizationReflush"];
        }

        public string AuthorizationRoutePath { get; set; }
        public string AuthorizationUserInfo { get; set; }
        public string AuthorizationLogout { get; set; }
        public string AuthorizationReflush { get; set; }
        public Dictionary<string, string> GetPathDictionary()
        {
            var result = new Dictionary<string, string>();
            result.Add("AuthorizationRoutePath", AuthorizationRoutePath);
            result.Add("AuthorizationUserInfo", AuthorizationUserInfo);
            result.Add("AuthorizationLogout", AuthorizationLogout);
            result.Add("AuthorizationReflush", AuthorizationReflush);
            return result;
        }
    }
}
